<?php $this->load->view("v-index/v-sidebar-home");
$i= $this->cart->total_items();
if($i==0){
    redirect("home");
}?>
  
    <!--container star  #map show-->
    <div class="container min-height-contact">
    <table class="table table-striped ">
      <thead>
        <tr>
          <th >Tên sản phẩm</th>
          <th>Giá</th>
          <th>Số lượng</th>
          <th>Thành tiền</th>
        </tr>
      </thead>
      <tbody>
      <form method="post" action="<?php echo site_url("home/update_cart") ?>">
      <?php foreach($data as $row){?>
        <tr>
          
          <td><?php echo $row['name'] ?></td>
          <td><?php echo number_format($row['price']) ?>&nbsp;VNĐ</td>
          <td><input type="number" name="<?php echo $row["rowid"] ?>" value="<?php echo $row["qty"]?>" style=" width: 50px; " class="text-center"></td>
          <td><?php echo number_format($row['subtotal']) ?>&nbsp;VNĐ</td>
        </tr>
        <?php } ?>
       <tr>
          <td colspan="3">Tổng cộng</td>
          <td><?php echo number_format($this->cart->total()) ?>&nbsp;VNĐ</td>
          
        </tr>
        <tr>
          <td ><a href="thanhtoan" title="thanh toán" class="btn btn-sm btn-success">Thanh toán</a></td>
          <td><input type="submit" value="Cập nhật" class="btn btn-sm btn-success" name="btn_update" /></td>
          </form>
        </tr>
      </tbody>
    </table>
    </div>